package com.mariusz.managers;

import java.awt.CardLayout;

import com.mariusz.Main;

public class NavigationManager {
	private static NavigationManager instance = new NavigationManager();
	private Main window;
	public static NavigationManager getInstance(){
		return instance;
	}
	
	public void setMainWindow(Main window){
		this.window = window;
	}
	
	public void switchTo(Screen screen){
		CardLayout layout = (CardLayout) window.getContentPane().getLayout();
		layout.show(window.getContentPane(), screen.toString());
		window.repaint();
		window.validate();
	}
	public enum Screen{
		PROPERTIES("PROPERTIES"),
		PROPERTY_EDIT("PROPERTIES_EDIT"), 
		RENTIER_LIST("RENTIER_LIST"), 
		STATUS_PANEL("STATUS_PANEL"), 
		RENTIER_DETAILS("RENTIER_DETAILS"), 
		LOCATORS("LOCATORS_PANEL"),
		LANDLORDS("LANDLORDS");
		private String name;
		Screen(String s){
			name = s;
		}
		public String toString(){
			return name;
		}
	}
}
